package com.darren.euc.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.darren.euc.entity.PageBean;

public interface BaseDao<T,PK extends Serializable> {
	
	public T save(T entity);
	
	public T merge(T entity);
	
	public T findById(PK id);
	
	public T update(T entity);
	
	public void delete(T entity);

    public List<Map> getDataMapList(String sql, Object... objs);
    
    public Map<String, Object> getDataMap(String sql,Object... objs);

    /**
     * 
     * @param sql
     * @param pageSize
     * @param currentPage
     * @param objs
     * @return
     */
    public PageBean queryForPageBySQL(String sql,Integer pageSize, Integer currentPage, Object... objs);
    
    
    public List<T> queryByCondition(String hql,Object... objs);

    /**
     *
     * @param parameterJson
     * @param pageSize
     * @param currentPage
     * @return
     */
    public PageBean queryForPageByHQL(String hql,Integer pageSize, Integer currentPage,Object... objs);

}